-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbd: return error if last sync time not present #3489
Conversation
2e0afdf
to
c4ec529
Compare
go.mod
Outdated
@@ -27,7 +27,7 @@ require ( | |||
github.com/pkg/xattr v0.4.7 | |||
github.com/prometheus/client_golang v1.12.2 | |||
github.com/stretchr/testify v1.8.1 | |||
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd | |||
golang.org/x/crypto v0.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this got updated as part of go get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ShyamsundarR PTAL at last commit. This check was missing, and cephcsi was returning an empty response. |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
1a48237
to
7c1cbef
Compare
Thanks, I am only looking at overall structural correctness (hence not hitting the approved button). @yati1998 assuming you are taking a closer look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, but (a nit) the formatting of the error messages should be nicer.
if description == "" { | ||
return nil, nil | ||
return nil, fmt.Errorf("%w empty description", ErrLastSyncTimeNotFound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing :
after %w
?
} | ||
splittedString := strings.SplitN(description, ",", 2) | ||
if len(splittedString) == 1 { | ||
return nil, nil | ||
return nil, fmt.Errorf("%w no local snapshot timestamp", ErrLastSyncTimeNotFound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, formatting of error messages matter
7c1cbef
to
642daa6
Compare
This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏 |
As per the csiaddon spec last sync time is required parameter in the GetVolumeReplicationInfo if we are failed to parse the description, return not found error message instead of nil which is empty response Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
csi-addons/spec#47 defines the error messages for the GetVolumeReplicationInfo RPC call. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Sometime the json unmarshal might get success and return empty time stamp. add a check to make sure the time is not zero always. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
642daa6
to
9f7624f
Compare
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Mergifyio rebase |
☑️ Nothing to do
|
/test ci/centos/k8s-e2e-external-storage/1.23 |
/test ci/centos/k8s-e2e-external-storage/1.24 |
/test ci/centos/k8s-e2e-external-storage/1.25 |
/test ci/centos/mini-e2e-helm/k8s-1.23 |
/test ci/centos/mini-e2e-helm/k8s-1.24 |
/test ci/centos/mini-e2e-helm/k8s-1.25 |
/test ci/centos/mini-e2e/k8s-1.23 |
/test ci/centos/mini-e2e/k8s-1.24 |
/test ci/centos/mini-e2e/k8s-1.25 |
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/upgrade-tests-rbd |
As per the csiaddon spec, last sync time is a required parameter in the GetVolumeReplicationInfo if we are failed to parse the description, we return an error message instead of nil which is an empty response.
Signed-off-by: Madhu Rajanna madhupr007@gmail.com
Note:- skipping E2E as we dont have CI for DR
Note:- Replacement for #3478 after discussion in csiaddons spec.